home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_input_file.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  5.0 KB  |  96 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="400" height="310" caption="File box">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblSize" caption="Size" hint="Size of the element measured in number of characters." width="52" height="13" top="8" left="200"/>
  6.             <label name="lblName" caption="Name" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="29" height="13" top="8" left="8"/>
  7.             <label name="lblAccept" caption="Accept" hint="A list of accepted MIME types. Seperate with a comma." width="50" height="13" top="56" left="8"/>
  8.             <edit name="edtName" taborder="0" text="" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="175" height="19" top="24" left="8"/>
  9.             <checkbox name="cbDisabled" caption="Disabled" taborder="4" hint="Your element will be visible, but disabled." checked="0" width="121" height="17" top="104" left="200"/>
  10.             <checkbox name="cbReadonly" caption="Readonly" taborder="3" hint="If your element is readonly, the user will not be able to make any changes to it." checked="0" width="121" height="17" top="104" left="8"/>
  11.             <spinedit name="speSize" taborder="1" hint="Size of the element measured in number of characters." maxvalue="0" minvalue="0" value="0" width="175" height="20" top="24" left="200"/>
  12.             <edit name="edtAccept" taborder="2" text="" hint="A list of accepted MIME types. Seperate with a comma." width="369" height="19" top="72" left="8"/>
  13.         </panel>
  14.     </controls>
  15.     <dialogevents>
  16.         <event type="onclose" resulttype="ok">
  17.             StartCode := '<input type="file"';
  18.             If edtName.Text <> '' then
  19.              StartCode := Startcode + ' name="'+(edtName.Text)+'"';
  20.             If edtAccept.Text <> '' then
  21.              StartCode := Startcode + ' accept="'+(edtAccept.Text)+'"';
  22.             If speSize.Value > 0 then
  23.              StartCode := Startcode + ' size="'+IntToStr(speSize.Value)+'"';
  24.             if cbReadonly.Checked then
  25.              StartCode := Startcode + ' readonly';
  26.             if cbDisabled.Checked then
  27.               StartCode := Startcode + ' disabled';
  28.                 
  29.               If edtCSSClass.Text <> '' then
  30.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  31.               If edtCSSId.Text <> '' then
  32.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  33.               If edtCSSStyle.Text <> '' then
  34.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  35.             for i := 0 to EventGrid.Count - 1 do
  36.               begin
  37.               if EventGrid.Rows[i].EditText <> '' then
  38.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  39.              end;    
  40.  
  41.             StartCode := StartCode + '>';
  42.             If cbMakeXHTMLCompliant.Checked then
  43.              StartCode := MakeXHTMLCompliant(StartCode, false);
  44.             If cbDoPHPEscape.Checked then
  45.              StartCode := DoPHPEscape(StartCode);         
  46.             // A little "hack" - WebCoder will set this, to let us know whether to update
  47.             // an existing tag, or insert a brand new one
  48.             If cbUpdateExistingTag.Checked then 
  49.              ReplaceTag(StartCode)
  50.             else 
  51.                InsertTags(StartCode, '');   
  52.               
  53.         </event>
  54.         <event type="onshow">    
  55.             // Lets put the advanced panel in the right place
  56.             pnlAdvanced.Parent := MainPanel;
  57.             pnlAdvanced.Left := 8;
  58.             pnlAdvanced.Top := MainPanel.Height - 32;        
  59.             pnlAdvanced.Width := Self.Width - 36;
  60.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  61.             If pnlAdvanced.Height > 20 then
  62.              Self.Height := Self.Height + 200;
  63.         </event>
  64.         <event type="updatedialog">
  65.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  66.             // The entire selected tag will be passed as a parameter to this function, that should update
  67.             // the required fields of the dialog.
  68.             function UpdateDialog(Tag: string);
  69.              begin
  70.             
  71.               edtName.Text := GetValueFromAttribute(Tag, 'name');
  72.               edtAccept.Text := GetValueFromAttribute(Tag, 'accept');
  73.                             
  74.               Size := GetValueFromAttribute(Tag, 'size');
  75.               If Size <> '' then
  76.                speSize.Value := StrToInt(Size);
  77.              
  78.               cbReadonly.Checked := HasOption(Tag, 'readonly'); 
  79.               cbDisabled.Checked := HasOption(Tag, 'disabled');             
  80.             
  81.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  82.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  83.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  84.               for i := 0 to EventGrid.Count - 1 do
  85.                 begin
  86.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  87.                  If EventVal <> '' then
  88.                   EventGrid.Rows[i].EditText := EventVal;
  89.                end;  
  90.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  91.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                            
  92.              end;
  93.         </event>
  94.     </dialogevents>
  95. </dialog>
  96.